package com.eva.service.system.impl;

import com.eva.core.model.PageData;
import com.eva.core.model.PageWrap;
import com.eva.dao.system.dto.QuerySystemInterfaceConfigListDTO;
import com.eva.dao.system.vo.SystemInterfaceConfigListVO;
import com.eva.service.system.SystemInterfaceConfigListService;
import com.eva.dao.system.SystemInterfaceConfigListMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 系统接口配置Service实现
 * @author Eva.Caesar Liu
 * @date 2022/04/02 21:57
 */
@Service
public class SystemInterfaceConfigListServiceImpl implements SystemInterfaceConfigListService {

    @Autowired
    private SystemInterfaceConfigListMapper systemInterfaceConfigListMapper;

    @Override
    public PageData<SystemInterfaceConfigListVO> findPage(PageWrap<QuerySystemInterfaceConfigListDTO> pageWrap) {
        PageHelper.startPage(pageWrap.getPage(), pageWrap.getCapacity());
        List<SystemInterfaceConfigListVO> result = systemInterfaceConfigListMapper.selectList(pageWrap.getModel());
        return PageData.from(new PageInfo<>(result));
    }
}
